package com.gator.desig_mode.flyweigth;


/**
 * @author 何章怀晓 hezhanghuaixiao
 * @version V1.0
 * @desc
 */
public class Client {

  public static void main(String[] args) {

    WebSiteFactory webSiteFactory = new WebSiteFactory();

    System.out.println("初始数量:" + webSiteFactory.getTypeNum());
    System.out.println();
    System.out.println("放入H5");
    WebSite webSite = webSiteFactory.getWebSite(0);
    webSite.use();
    System.out.println("池中对象数量:" + webSiteFactory.getTypeNum());
    System.out.println();

    System.out.println("放入App");
    webSite = webSiteFactory.getWebSite(1);
    webSite.use();
    System.out.println("池中对象数量:" + webSiteFactory.getTypeNum());

    System.out.println("再次使用H5..........");

    webSite = webSiteFactory.getWebSite(0);
    webSite.use();

    System.out.println("池中对象数量:" + webSiteFactory.getTypeNum());
  }

}
